<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div class="yeye">
        <div class="dad">
            <div class="baby"></div>
        </div>
    </div>
    <script>
        const baby = document.querySelector('.baby')
        console.log(baby);
        console.log(baby.parentNode);//获得dad对象
        console.log(baby.parentNode.parentNode);//获得dom对象  yeye

    </script>
</body>

</html>